<!DOCTYPE html>

<html lang="en">
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Class Phalcon\Tag &mdash; Phalcon 2.0.0 文档</title>
    <meta name="keywords" content="php, phalcon, phalcon php, php framework, faster php framework"><link rel="stylesheet" type="text/css" href="../_static/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://static.phalconphp.com/css/phalcon.min.css" />
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400' rel='stylesheet' type='text/css'>
    <link href="http://fonts.googleapis.com/css?family=Merriweather:400,700" rel="stylesheet" type="text/css" />
    <!--
    EUROPE <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=latin-ext' rel='stylesheet' type='text/css'>
    GREEK <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=greek-ext' rel='stylesheet' type='text/css'>
    RUSSIA <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=cyrillic-ext,latin' rel='stylesheet' type='text/css'>
    -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>

    <script src="../_static/jquery.min.js"></script>
    <script type="text/javascript" src="../_static/docs.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Phalcon 2.0.0 文档" href="../index.html" />
    <link rel="up" title="API Indice" href="index.html" />
    <link rel="next" title="Class Phalcon\Tag\Exception" href="Phalcon_Tag_Exception.html" />
    <link rel="prev" title="Class Phalcon\Session\Exception" href="Phalcon_Session_Exception.html" /> 
  </head>
  <body>

<header class="page-header">
    <nav class="navbar" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-container">
                    <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
                </button>
                <a class="navbar-brand phalcon-logo" href="/"><span itemprop="name" class="sr-only">Phalcon PHP</span></a>
            </div>

            <div class="collapse navbar-collapse navbar-right" id="main-menu-container">
                <ul class="nav navbar-nav main-menu">
                  <li class="first"><a href="http://phalconphp.com/en/download" class="header-nav-link">Download</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="http://blog.phalconphp.com/" class="header-nav-link" target="_blank">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                </ul>
            </div>
        </div>
    </nav>
  </header>

<div class="heading">
    <div class="container">
        <div class="row">
            <h2>Documentation</h2>
        </div>
    </div>
</div>
    <!--<div class="header-line">
      <div class="size-wrap">
        <div class="header-line-title title-white">Documentation</div>
      </div>
    </div>-->
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="Phalcon_Tag_Exception.html" title="Class Phalcon\Tag\Exception"
             accesskey="N">下一页</a> |</li>
        <li class="right" >
          <a href="Phalcon_Session_Exception.html" title="Class Phalcon\Session\Exception"
             accesskey="P">上一页</a> |</li>
        <li><a href="http://phalconphp.com">Home</a> &raquo;</li>
        <li><a href="../index.html">Phalcon 2.0.0 文档</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">API Indice</a> &raquo;</li> 
      </ul>
    </div>  

      <table width="100%" align="center" cellpadding="0" cellspacing="0">
        <tr>
      <td class="primary-box" width="25%" valign="top">
            <div>
            <div id="searchbox" style="">
                <!--<form class="search" action="http://readthedocs.org/search/project/" method="get">
                  <input type="search" name="q" size="25" placeholder="Search">
                  <input type="submit" value="Go">
                  <input type="hidden" name="selected_facets" value="project:">
                </form>-->
                <div style="width:200px;padding:10px">
                  <gcse:searchbox-only></gcse:searchbox-only>
                </div>
            </div>
            </div>
            <div style="padding:5px;padding-left:10px">
              <div id="carbonads-container">
                <div class="carbonad"><div id="azcarbon"></div>
                <script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/56496/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
                </div></div>
            </div>
            <h3><a href="../index.html">內容目录</a></h3>
            <ul>
<li><a class="reference internal" href="#">Class <strong>Phalcon\Tag</strong></a><ul>
<li><a class="reference internal" href="#constants">Constants</a></li>
<li><a class="reference internal" href="#methods">Methods</a></li>
</ul>
</li>
</ul>

            <h4>上一个主题</h4>
            <p class="topless"><a href="Phalcon_Session_Exception.html" title="上一章">&lt; Class <strong>Phalcon\Session\Exception</strong></a></p>
            <h4>下一个主题</h4>
            <p class="topless"><a href="Phalcon_Tag_Exception.html" title="下一章">Class <strong>Phalcon\Tag\Exception</strong> &gt;</a></p>
            <h3>本页</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/api/Phalcon_Tag.txt" rel="nofollow">显示源代码</a></li>
            </ul>
        </td>
          <td class="second-box" valign="top">
            <div class="document">
                <div class="documentwrapper">
                  <div class="bodywrapper">
                    <div class="body" >
                      
  <div class="section" id="class-phalcon-tag">
<h1>Class <strong>Phalcon\Tag</strong><a class="headerlink" href="#class-phalcon-tag" title="永久链接至标题">¶</a></h1>
<p>Phalcon\Tag is designed to simplify building of HTML tags. It provides a set of helpers to generate HTML in a dynamic way. This component is an abstract class that you can extend to add more helpers.</p>
<div class="section" id="constants">
<h2>Constants<a class="headerlink" href="#constants" title="永久链接至标题">¶</a></h2>
<p><em>integer</em> <strong>HTML32</strong></p>
<p><em>integer</em> <strong>HTML401_STRICT</strong></p>
<p><em>integer</em> <strong>HTML401_TRANSITIONAL</strong></p>
<p><em>integer</em> <strong>HTML401_FRAMESET</strong></p>
<p><em>integer</em> <strong>HTML5</strong></p>
<p><em>integer</em> <strong>XHTML10_STRICT</strong></p>
<p><em>integer</em> <strong>XHTML10_TRANSITIONAL</strong></p>
<p><em>integer</em> <strong>XHTML10_FRAMESET</strong></p>
<p><em>integer</em> <strong>XHTML11</strong></p>
<p><em>integer</em> <strong>XHTML20</strong></p>
<p><em>integer</em> <strong>XHTML5</strong></p>
</div>
<div class="section" id="methods">
<h2>Methods<a class="headerlink" href="#methods" title="永久链接至标题">¶</a></h2>
<p>public static  <strong>getEscaper</strong> (<em>unknown</em> $params)</p>
<p>Obtains the &#8216;escaper&#8217; service if required</p>
<p>public static <em>string</em>  <strong>renderAttributes</strong> (<em>unknown</em> $code, <em>unknown</em> $attributes)</p>
<p>Renders parameters keeping order in their HTML attributes</p>
<p>public static  <strong>setDI</strong> (<em>unknown</em> $dependencyInjector)</p>
<p>Sets the dependency injector container.</p>
<p>public static <a class="reference internal" href="Phalcon_DiInterface.html"><em>Phalcon\DiInterface</em></a>  <strong>getDI</strong> ()</p>
<p>Internally gets the request dispatcher</p>
<p>public static <a class="reference internal" href="Phalcon_Mvc_UrlInterface.html"><em>Phalcon\Mvc\UrlInterface</em></a>  <strong>getUrlService</strong> ()</p>
<p>Returns a URL service from the default DI</p>
<p>public static <a class="reference internal" href="Phalcon_EscaperInterface.html"><em>Phalcon\EscaperInterface</em></a>  <strong>getEscaperService</strong> ()</p>
<p>Returns an Escaper service from the default DI</p>
<p>public static  <strong>setAutoescape</strong> (<em>unknown</em> $autoescape)</p>
<p>Set autoescape mode in generated html</p>
<p>public static  <strong>setDefault</strong> (<em>unknown</em> $id, <em>unknown</em> $value)</p>
<p>Assigns default values to generated tags by helpers</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="c1">//Assigning &quot;peter&quot; to &quot;name&quot; component</span>
 <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">setDefault</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="s2">&quot;peter&quot;</span><span class="p">);</span>

 <span class="c1">//Later in the view</span>
 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">textField</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">);</span> <span class="c1">//Will have the value &quot;peter&quot; by default</span>
</pre></div>
</div>
<p>public static  <strong>setDefaults</strong> (<em>unknown</em> $values, [<em>unknown</em> $merge])</p>
<p>Assigns default values to generated tags by helpers</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="c1">//Assigning &quot;peter&quot; to &quot;name&quot; component</span>
 <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">setDefaults</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;name&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;peter&quot;</span><span class="p">));</span>

 <span class="c1">//Later in the view</span>
 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">textField</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">);</span> <span class="c1">//Will have the value &quot;peter&quot; by default</span>
</pre></div>
</div>
<p>public static  <strong>displayTo</strong> (<em>unknown</em> $id, <em>unknown</em> $value)</p>
<p>Alias of Phalcon\Tag::setDefault</p>
<p>public static <em>boolean</em>  <strong>hasValue</strong> (<em>unknown</em> $name)</p>
<p>Check if a helper has a default value set using Phalcon\Tag::setDefault or value from _POST</p>
<p>public static <em>mixed</em>  <strong>getValue</strong> (<em>unknown</em> $name, [<em>unknown</em> $params])</p>
<p>Every helper calls this function to check whether a component has a predefined value using Phalcon\Tag::setDefault or value from _POST</p>
<p>public static  <strong>resetInput</strong> ()</p>
<p>Resets the request and internal values to avoid those fields will have any default value</p>
<p>public static <em>string</em>  <strong>linkTo</strong> (<em>unknown</em> $parameters, [<em>unknown</em> $text], [<em>unknown</em> $local])</p>
<p>Builds a HTML A tag using framework conventions</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">linkTo</span><span class="p">(</span><span class="s2">&quot;signup/register&quot;</span><span class="p">,</span> <span class="s2">&quot;Register Here!&quot;</span><span class="p">);</span>
<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">linkTo</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;signup/register&quot;</span><span class="p">,</span> <span class="s2">&quot;Register Here!&quot;</span><span class="p">));</span>
<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">linkTo</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;signup/register&quot;</span><span class="p">,</span> <span class="s2">&quot;Register Here!&quot;</span><span class="p">,</span> <span class="s2">&quot;class&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;btn-primary&quot;</span><span class="p">));</span>
<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">linkTo</span><span class="p">(</span><span class="s2">&quot;http://phalconphp.com/&quot;</span><span class="p">,</span> <span class="s2">&quot;Phalcon&quot;</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">);</span>
<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">linkTo</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;http://phalconphp.com/&quot;</span><span class="p">,</span> <span class="s2">&quot;Phalcon Home&quot;</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">));</span>
<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">linkTo</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;http://phalconphp.com/&quot;</span><span class="p">,</span> <span class="s2">&quot;Phalcon Home&quot;</span><span class="p">,</span> <span class="s2">&quot;local&quot;</span> <span class="o">=&gt;</span><span class="k">FALSE</span><span class="p">));</span>
</pre></div>
</div>
<p>final protected static <em>string</em>  <strong>_inputField</strong> (<em>unknown</em> $type, <em>unknown</em> $parameters, [<em>unknown</em> $asValue])</p>
<p>Builds generic INPUT tags</p>
<p>final protected static <em>string</em>  <strong>_inputFieldChecked</strong> (<em>unknown</em> $type, <em>unknown</em> $parameters)</p>
<p>Builds INPUT tags that implements the checked attribute</p>
<p>public static <em>string</em>  <strong>colorField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;color&#8221;] tag</p>
<p>public static <em>string</em>  <strong>textField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;text&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">textField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="s2">&quot;size&quot;</span> <span class="o">=&gt;</span> <span class="mi">30</span><span class="p">));</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>numericField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;number&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">numericField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;price&quot;</span><span class="p">,</span> <span class="s2">&quot;min&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;1&quot;</span><span class="p">,</span> <span class="s2">&quot;max&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;5&quot;</span><span class="p">));</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>rangeField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;range&#8221;] tag</p>
<p>public static <em>string</em>  <strong>emailField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;email&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">emailField</span><span class="p">(</span><span class="s2">&quot;email&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>dateField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;date&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">dateField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;born&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;14-12-1980&quot;</span><span class="p">))</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>dateTimeField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;datetime&#8221;] tag</p>
<p>public static <em>string</em>  <strong>dateTimeLocalField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;datetime-local&#8221;] tag</p>
<p>public static <em>string</em>  <strong>monthField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;month&#8221;] tag</p>
<p>public static <em>string</em>  <strong>timeField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;time&#8221;] tag</p>
<p>public static <em>string</em>  <strong>weekField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;week&#8221;] tag</p>
<p>public static <em>string</em>  <strong>passwordField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;password&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">passwordField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="s2">&quot;size&quot;</span> <span class="o">=&gt;</span> <span class="mi">30</span><span class="p">));</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>hiddenField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;hidden&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">hiddenField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;mike&quot;</span><span class="p">));</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>fileField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;file&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">fileField</span><span class="p">(</span><span class="s2">&quot;file&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>searchField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;search&#8221;] tag</p>
<p>public static <em>string</em>  <strong>telField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;tel&#8221;] tag</p>
<p>public static <em>string</em>  <strong>urlField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;url&#8221;] tag</p>
<p>public static <em>string</em>  <strong>checkField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;check&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">checkField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;terms&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;Y&quot;</span><span class="p">));</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>radioField</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;radio&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">radioField</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;weather&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;hot&quot;</span><span class="p">))</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">radio_field</span><span class="p">(</span><span class="s2">&quot;Save&quot;</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>imageInput</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;image&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">imageInput</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;src&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;/img/button.png&quot;</span><span class="p">));</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">image_input</span><span class="p">(</span><span class="s2">&quot;src&quot;</span><span class="o">:</span> <span class="s2">&quot;/img/button.png&quot;</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>submitButton</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML input[type=&#8221;submit&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">submitButton</span><span class="p">(</span><span class="s2">&quot;Save&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">submit_button</span><span class="p">(</span><span class="s2">&quot;Save&quot;</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>selectStatic</strong> (<em>unknown</em> $parameters, [<em>unknown</em> $data])</p>
<p>Builds a HTML SELECT tag using a PHP array for options</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">selectStatic</span><span class="p">(</span><span class="s2">&quot;status&quot;</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s2">&quot;A&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;Active&quot;</span><span class="p">,</span> <span class="s2">&quot;I&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;Inactive&quot;</span><span class="p">))</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>select</strong> (<em>unknown</em> $parameters, [<em>unknown</em> $data])</p>
<p>Builds a HTML SELECT tag using a Phalcon\Mvc\Model resultset as options</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">select</span><span class="p">(</span><span class="k">array</span><span class="p">(</span>
    <span class="s2">&quot;robotId&quot;</span><span class="p">,</span>
    <span class="nx">Robots</span><span class="o">::</span><span class="na">find</span><span class="p">(</span><span class="s2">&quot;type = &quot;</span><span class="nx">mechanical</span><span class="s2">&quot;&quot;</span><span class="p">),</span>
    <span class="s2">&quot;using&quot;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">)</span>
    <span class="p">));</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">select</span><span class="p">(</span><span class="s2">&quot;robotId&quot;</span><span class="p">,</span> <span class="nx">robots</span><span class="p">,</span> <span class="s2">&quot;using&quot;</span><span class="o">:</span> <span class="p">[</span><span class="s2">&quot;id&quot;</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">])</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>textArea</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML TEXTAREA tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">textArea</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;comments&quot;</span><span class="p">,</span> <span class="s2">&quot;cols&quot;</span> <span class="o">=&gt;</span> <span class="mi">10</span><span class="p">,</span> <span class="s2">&quot;rows&quot;</span> <span class="o">=&gt;</span> <span class="mi">4</span><span class="p">))</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">text_area</span><span class="p">(</span><span class="s2">&quot;comments&quot;</span><span class="p">,</span> <span class="s2">&quot;cols&quot;</span><span class="o">:</span> <span class="mi">10</span><span class="p">,</span> <span class="s2">&quot;rows&quot;</span><span class="o">:</span> <span class="mi">4</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>form</strong> (<em>unknown</em> $parameters)</p>
<p>Builds a HTML FORM tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">form</span><span class="p">(</span><span class="s2">&quot;posts/save&quot;</span><span class="p">);</span>
 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">form</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;posts/save&quot;</span><span class="p">,</span> <span class="s2">&quot;method&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;post&quot;</span><span class="p">));</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">form</span><span class="p">(</span><span class="s2">&quot;posts/save&quot;</span><span class="p">)</span> <span class="p">}}</span>
 <span class="p">{{</span> <span class="nx">form</span><span class="p">(</span><span class="s2">&quot;posts/save&quot;</span><span class="p">,</span> <span class="s2">&quot;method&quot;</span><span class="o">:</span> <span class="s2">&quot;post&quot;</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>endForm</strong> ()</p>
<p>Builds a HTML close FORM tag</p>
<p>public static  <strong>setTitle</strong> (<em>unknown</em> $title)</p>
<p>Set the title of view content</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">setTitle</span><span class="p">(</span><span class="s2">&quot;Welcome to my Page&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>public static  <strong>setTitleSeparator</strong> (<em>unknown</em> $titleSeparator)</p>
<p>Set the title separator of view content</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">setTitleSeparator</span><span class="p">(</span><span class="s2">&quot;-&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>public static  <strong>appendTitle</strong> (<em>unknown</em> $title)</p>
<p>Appends a text to current document title</p>
<p>public static  <strong>prependTitle</strong> (<em>unknown</em> $title)</p>
<p>Prepends a text to current document title</p>
<p>public static <em>string</em>  <strong>getTitle</strong> ([<em>unknown</em> $tags])</p>
<p>Gets the current document title</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

    <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">getTitle</span><span class="p">();</span>
</pre></div>
</div>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

    <span class="p">{{</span> <span class="nx">get_title</span><span class="p">()</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>getTitleSeparator</strong> ()</p>
<p>Gets the current document title separator</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

         <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">getTitleSeparator</span><span class="p">();</span>
</pre></div>
</div>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

         <span class="p">{{</span> <span class="nx">get_title_separator</span><span class="p">()</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>stylesheetLink</strong> ([<em>unknown</em> $parameters], [<em>unknown</em> $local])</p>
<p>Builds a LINK[rel=&#8221;stylesheet&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

    <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">stylesheetLink</span><span class="p">(</span><span class="s2">&quot;http://fonts.googleapis.com/css?family=Rosario&quot;</span><span class="p">,</span> <span class="k">false</span><span class="p">);</span>
    <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">stylesheetLink</span><span class="p">(</span><span class="s2">&quot;css/style.css&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>Volt Syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

    <span class="p">{{</span> <span class="nx">stylesheet_link</span><span class="p">(</span><span class="s2">&quot;http://fonts.googleapis.com/css?family=Rosario&quot;</span><span class="p">,</span> <span class="k">false</span><span class="p">)</span> <span class="p">}}</span>
    <span class="p">{{</span> <span class="nx">stylesheet_link</span><span class="p">(</span><span class="s2">&quot;css/style.css&quot;</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>javascriptInclude</strong> ([<em>unknown</em> $parameters], [<em>unknown</em> $local])</p>
<p>Builds a SCRIPT[type=&#8221;javascript&#8221;] tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

         <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">javascriptInclude</span><span class="p">(</span><span class="s2">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&quot;</span><span class="p">,</span> <span class="k">false</span><span class="p">);</span>
         <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">javascriptInclude</span><span class="p">(</span><span class="s2">&quot;javascript/jquery.js&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>Volt syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="p">{{</span> <span class="nx">javascript_include</span><span class="p">(</span><span class="s2">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&quot;</span><span class="p">,</span> <span class="k">false</span><span class="p">)</span> <span class="p">}}</span>
 <span class="p">{{</span> <span class="nx">javascript_include</span><span class="p">(</span><span class="s2">&quot;javascript/jquery.js&quot;</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>image</strong> ([<em>unknown</em> $parameters], [<em>unknown</em> $local])</p>
<p>Builds HTML IMG tags</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

         <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">image</span><span class="p">(</span><span class="s2">&quot;img/bg.png&quot;</span><span class="p">);</span>
         <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">image</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s2">&quot;img/photo.jpg&quot;</span><span class="p">,</span> <span class="s2">&quot;alt&quot;</span> <span class="o">=&gt;</span> <span class="s2">&quot;Some Photo&quot;</span><span class="p">));</span>
</pre></div>
</div>
<p>Volt Syntax:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

         <span class="p">{{</span> <span class="nx">image</span><span class="p">(</span><span class="s2">&quot;img/bg.png&quot;</span><span class="p">)</span> <span class="p">}}</span>
         <span class="p">{{</span> <span class="nx">image</span><span class="p">(</span><span class="s2">&quot;img/photo.jpg&quot;</span><span class="p">,</span> <span class="s2">&quot;alt&quot;</span><span class="o">:</span> <span class="s2">&quot;Some Photo&quot;</span><span class="p">)</span> <span class="p">}}</span>
         <span class="p">{{</span> <span class="nx">image</span><span class="p">(</span><span class="s2">&quot;http://static.mywebsite.com/img/bg.png&quot;</span><span class="p">,</span> <span class="k">false</span><span class="p">)</span> <span class="p">}}</span>
</pre></div>
</div>
<p>public static <em>text</em>  <strong>friendlyTitle</strong> (<em>unknown</em> $text, [<em>unknown</em> $separator], [<em>unknown</em> $lowercase], [<em>unknown</em> $replace])</p>
<p>Converts texts into URL-friendly titles</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

 <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">friendlyTitle</span><span class="p">(</span><span class="s2">&quot;These are big important news&quot;</span><span class="p">,</span> <span class="s2">&quot;-&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>public static  <strong>setDocType</strong> (<em>unknown</em> $doctype)</p>
<p>Set the document type of content</p>
<p>public static <em>string</em>  <strong>getDocType</strong> ()</p>
<p>Get the document type declaration of content</p>
<p>public static <em>string</em>  <strong>tagHtml</strong> (<em>unknown</em> $tagName, [<em>unknown</em> $parameters], [<em>unknown</em> $selfClose], [<em>unknown</em> $onlyStart], [<em>unknown</em> $useEol])</p>
<p>Builds a HTML tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

        <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">tagHtml</span><span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">parameters</span><span class="p">,</span> <span class="nx">selfClose</span><span class="p">,</span> <span class="nx">onlyStart</span><span class="p">,</span> <span class="nx">eol</span><span class="p">);</span>
</pre></div>
</div>
<p>public static <em>string</em>  <strong>tagHtmlClose</strong> (<em>unknown</em> $tagName, [<em>unknown</em> $useEol])</p>
<p>Builds a HTML tag closing tag</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

        <span class="k">echo</span> <span class="nx">Phalcon\Tag</span><span class="o">::</span><span class="na">tagHtmlClose</span><span class="p">(</span><span class="s2">&quot;script&quot;</span><span class="p">,</span> <span class="k">true</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>


                    </div>
                  </div>
                </div>
            </div>
          </td>
        </tr>
      </table>
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             >索引</a></li>
        <li class="right" >
          <a href="Phalcon_Tag_Exception.html" title="Class Phalcon\Tag\Exception"
             >下一页</a> |</li>
        <li class="right" >
          <a href="Phalcon_Session_Exception.html" title="Class Phalcon\Session\Exception"
             >上一页</a> |</li>
          <li class="right"><a href="index.html" >API Indice</a> &raquo;</li> 
      </ul>
    </div>

      <div class="prefooter">
  <div class="container">
      <div class="row">
          <div class="col-sm-3 text-right">
              <span>Follow along:</span>
          </div>
          <div class="col-sm-6 text-center">
              <a href="https://twitter.com/phalconphp" alt="Twitter" class="btn-social btn-social-twitter"><i class="icon-twitter"></i></a>
              <a href="https://www.facebook.com/pages/Phalcon-Framework/134230726685897" alt="Facebook" class="btn-social btn-social-facebook"><i class="icon-facebook"></i></a>
              <a href="https://plus.google.com/102376109340560896457" alt="Google+" class="btn-social btn-social-googleplus"><i class="icon-googleplus"></i></a>
              <a href="https://github.com/phalcon/cphalcon" alt="Github" class="btn-social btn-social-github"><i class="icon-github"></i></a>
          </div>
          <div class="col-sm-3">
          </div>
      </div>
  </div>

</div>
<footer class="footer">
  <div class="container">
      <div class="row">
          <div class="col-xs-4 col-sm-3">
              <h4>Download</h4>
              <ul>
                  <li><a href="http://phalconphp.com/download">Installing Phalcon</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://api.phalconphp.com">API</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html">Tutorial</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html#sample-applications">Sample Applications</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-3">
              <h4>Community</h4>
              <ul>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon">GitHub</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon/issues">Issue Tracker</a></li>
                  <li><a href="http://stackoverflow.com/questions/tagged/phalcon">Stack Overflow</a></li>
                  <li><a href="http://phalconphp.com/en/testimonials">Testimonials</a></li>
                  <li><a href="http://builtwith.phalconphp.com/">Built with Phalcon</a></li>
                  <li><a href="http://store.phalconphp.com/">Store</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-2">
              <h4>About</h4>
              <ul>
                  <li><a class="link-black" href="http://blog.phalconphp.com/">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                  <li><a href="http://phalconphp.com/en/team">Team</a></li>
                  <li><a href="http://phalconphp.com/en/roadmap">Roadmap</a></li>
                  <li><a href="http://phalconphp.com/en/donate">Donate</a></li>
                  <li><a href="http://phalconphp.com/en/consulting">Consulting</a></li>
                  <li><a href="http://phalconphp.com/en/hosting">Hosting</a></li>
              </ul>
          </div>
          <div id="license-spaccer" class="visible-xs"></div>
          <div id="license-wrapper" class="col-xs-12 col-sm-4">
              <p class="license">

                  Found a typo or an error? Want to improve this document? The documentation sources are available on <a href="http://github.com/phalcon/docs">Github</a><br>
                  Need support or have questions? Check our <a href="http://forum.phalconphp.com">Forum</a><br>
                  <br>

                  Phalcon Framework is released under the <a href="https://github.com/phalcon/cphalcon/blob/master/docs/LICENSE.md">new BSD license</a>.<br>
                  Except where otherwise noted, content on this site is licensed under the
                    <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License.</a>

                <div class="design">
                  <span>Designed by:</span>

                  <a href="http://www.fog-city.net/" class="fogcity" target="_blank" title="Fog City Software"><span>Fog City Software</span></a>
              </div>
          </div>
      </div>
  </div>
</footer>

    </div>
    <script type="text/javascript">
    $(window).on("load", function(){
      var cx = '009733439235723428699:lh9ltjgvdz8';
      var gcse = document.createElement('script');
      gcse.type = 'text/javascript';
      gcse.async = true;
      gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(gcse, s);
    });
    </script>

  </body>
</html>